<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>高校管理系统-报修详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="#"/>
    <link rel="stylesheet" href="../../layui/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../../layui/css/public.css" media="all">
    <style type="text/css">
        body {
            background-color: #ffffff;
        }

        .rowBlock .layui-form-item {
            display: inline-block;
        }

        .contentBlock .layui-form-item {
            width: 500px;
            height: 200px;
        }

        .contentBlock textarea {
            height: 120px;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form" style="margin: 80px 100px;">
    <div class="rowBlock">
        <div class="layui-form-item">
            <label class="layui-form-label required">学生姓名</label>
            <div class="layui-input-block">
                <input type="text" name="stuname" id="stuname" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">联系方式</label>
            <div class="layui-input-block">
                <input type="text" name="stutel" id="stutel" class="layui-input">
            </div>
        </div>
    </div>
    <div class="rowBlock">
        <div class="layui-form-item">
            <label class="layui-form-label required">宿舍区</label>
            <div class="layui-input-block">
                <input type="text" name="brarea" id="brarea" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">楼栋</label>
            <div class="layui-input-block">
                <input type="text" name="brbid" id="brbid" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">寝室</label>
            <div class="layui-input-block">
                <input type="text" name="brrid" id="brrid" class="layui-input">
            </div>
        </div>
    </div>
    <div class="rowBlock">
        <div class="layui-form-item">
            <label class="layui-form-label required">报修类型</label>
            <div class="layui-input-block">
                <input type="text" name="type" id="type" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">提交日期</label>
            <div class="layui-input-block">
                <input type="text" name="subtime" id="subtime" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">维修状态</label>
            <div class="layui-input-block">
                <select name="status" id="status" class="layui-input">
                    <option value="0">已处理</option>
                    <option value="1">未处理</option>
                    <option value="2">正在处理</option>
                </select>
            </div>
        </div>
    </div>
    <div class="contentBlock">
        <div class="layui-form-item">
            <label class="layui-form-label required">描述</label>
            <div class="layui-input-block">
                <textarea rows="5" name="content" id="content" class="layui-input"></textarea>
            </div>
        </div>
    </div>
</div>
<script src="../../layui/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.jquery;

        $(function () {
            var parentData = eval('(' + parent.detailData + ')');
            $("#stuname").val(parentData.stuname);
            $("#stutel").val(parentData.stutel);
            $("#brarea").val(parentData.brarea);
            $("#brbid").val(parentData.brbid);
            $("#brrid").val(parentData.brrid);
            $("#type").val(parentData.type);
            $("#content").val(parentData.content);
            $("#subtime").val(parentData.subtime);
            var statu = parentData.status;
            var value;
            if (statu == "已处理") {
                value = 0;
            } else if (statu == "未处理") {
                value = 1;
            } else {
                value = 2;
            }
            $("#status").val(value);

            // 要渲染才能使select更新
            form.render();
        });


    });
</script>
</body>
</html>